<%--
  Created by IntelliJ IDEA.
  User: yuzhihao
  Date: 2022/4/11
  Time: 15:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
    <link rel="shortcut icon" href="${pageContext.request.contextPath}/image/smallLogo.svg" type="image/x-icon">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/coupon.css">

    <style>

        <%--        悬浮在a标签上会出现的效果--%>
        .cus_title .logo .title_list li a:hover + span {
            background-image: url("${pageContext.request.contextPath}/image/list_buttom.png");
            background-size: 12px 6px;
        }

        /*给a标签上色*/
        .cus_title .logo .title_list li .coupon_activety {
            color: #23b7b7 !important;
        }

        /*给span标签加三角形*/
        .cus_title .logo .title_list li .promotions {
            background-image: url("${pageContext.request.contextPath}/image/list_buttom.png");
            background-size: 12px 6px;
        }

    </style>
</head>
<body>

<jsp:include page="../common/head.jsp"/>

<!--=========================================优惠活动主体========================================-->
<div class="special-offers">

    <c:if test="${!empty no_coupon}">
        <span style="color: red;position: relative;top:40px">${no_coupon}</span>
    </c:if>

    <c:if test="${!empty coupon}">
        <c:forEach items="${coupon}" var="list">
            <div class="coupon coupon-wave-left coupon-yellow">
                <div class="coupon-info coupon-hole coupon-info-right-dashed">
                    <div class="coupon-price">¥${list.sendCouponPrice}</div>
                    <div class="coupon-desc">${list.sendCouponRules}</div>
                    <c:if test="${!empty list.sendCouponStarttime && !empty list.sendCouponEndtime}">
                        <div class="coupon-expiry-date">有效期：
                            <fmt:formatDate value="${list.sendCouponStarttime}" pattern="yyyy-MM-dd"/>-
                            <fmt:formatDate value="${list.sendCouponEndtime}" pattern="yyyy-MM-dd"/>
                        </div>
                    </c:if>
                    <c:if test="${empty list.sendCouponStarttime && empty list.sendCouponEndtime}">
                        <div class="coupon-expiry-date">有效期：
                            永久可以领取
                        </div>
                    </c:if>
                </div>
                <div class="coupon-get coupon-get-already get-button">
                    <a href="${pageContext.request.contextPath}/coupon/receive?couponId=${list.sendCouponId}&memberId=${customer.memberId}">
                        <button class="get-button">立即领取</button>
                    </a>
                </div>
            </div>
        </c:forEach>
    </c:if>

</div>
</body>
</html>
